/**
 * Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef GE_OP_IMPL_KERNEL_REGISTRY_H
#define GE_OP_IMPL_KERNEL_REGISTRY_H
#include <cstdint>
#include <string>
#include <unordered_set>
#include "graph/debug/ge_error_codes.h"
#include "register/tiling_context.h"
#include "register/infer_shape_context.h"
#include "register/infer_datatype_context.h"
#include "graph/ascend_string.h"

namespace ge {
class AnyValue;
class KernelContext;
class TilingParseContext;


using InferShapeKernelFunc = uint32_t (*)(InferShapeContext*);
using InferDataTypeKernelFunc = uint32_t (*)(InferDataTypeContext*);
using InferShapeRangeKernelFunc = void (*)(void*);
using OpExecuteFunc = void (*)(void*);
using PrivateAttrList = void (*)(void*);
using PrivateAttrSet = void (*)(void*);

struct OpImplKernelRegistry {
    using TilingKernelFunc = uint32_t (*)(TilingContext *);
    using CompileInfoCreatorFunc = void *(*)();
    using CompileInfoDeleterFunc = void (*)(void *);
    using KernelFunc = uint32_t (*)(KernelContext *context);
    using TilingParseFunc = uint32_t (*)(TilingParseContext *context);

    struct OpImplFunctions {
        TilingKernelFunc tiling;
        KernelFunc tiling_parse;
        CompileInfoCreatorFunc compile_info_creator;
        CompileInfoDeleterFunc compile_info_deleter;
        size_t max_tiling_data_size = 0UL;
        uint8_t reserved_0_[6] = {0U};  // Reserved field, 8-byte aligned for unique_private_attrs
        uint8_t reserved_1_[8] = {0U};  // Reserved field, 8, do not directly use when only 8-byte left
    };
};
}  // namespace ge
#endif
